1. Field of the Invention
This invention relates to computer display systems and, more particularly, to methods and apparatus for providing an improved graphics accelerator capable of more rapidly producing multitextured three dimensional output images.
2. History of the Prior Art
In three dimensional graphics, surfaces are typically rendered by assembling a plurality of polygons in a desired shape. The polygons are conventionally triangles having vertices which are defined by three dimensional coordinates in world space, by color values, and by texture coordinates.
The surfaces represented by an assembly of polygons are, as a generality, being viewed in perspective. To display a surface on a computer monitor, the three dimensional world space coordinates are transformed into screen coordinates in which horizontal and vertical values (x, y) define screen position and a depth value z determines how near a vertex is to the screen and thus whether that vertex is viewed with respect to other points at the same screen coordinates. The color values define the brightness of each of red/green/blue (r, g, b) color at each vertex and thus the color (often called diffuse color) at each vertex. Texture coordinates (u, v) define texture map coordinates for each vertex on a particular texture map defined by values stored in memory.
A texture map typically describes a pattern to be applied to the surface of the triangle to vary the color in accordance with the pattern. The texture coordinates of the vertices of a triangular surface area fix the position of the vertices of the triangle on the texture map and thereby determine the texture detail applied to each portion of the surface within the triangle in accordance with the particular texture . In turn, the three dimensional coordinates of the vertices of a triangle positioned on the texture map define the plane in which the texture map and the surface lie with respect to the screen surface.
A texture which is applied to a surface in space may have a wide variety of characteristics. A texture may define a pattern such as a stone wall. It may define light reflected from positions on the surface. It may describe the degree of transparency of a surface and thus how other objects are seen through the surface. A texture may provide characteristics such a dirt and scratches which make a surface appear more realistic. A number of other variations may be provided which fall within the general description of a texture. In theory, a number of different textures may be applied to any triangular surface.
Prior art graphics accelerators which are capable of applying multiple textures to a triangle typically progress through a series of steps is which pixels describing each triangle are first generated, a first texture is mapped to the triangle using the texture coordinates, texels describing the variation of each pixel in the triangle for the first texture are generated, the texels describing the first texture and the pixel colors describing the triangle are blended, and the resulting triangle is blended with any image residing in a frame buffer from which the image may be presented on an output display. Then, a second texture is mapped to the same triangle, the texels for the additional texture are generated, and the resulting texels are again blended with the pixel colors. Finally, the triangle blended with the second texture is blended into the image residing in the frame buffer.
As is known to those skilled in the art, the need to transit the graphics pipeline for each texture applied to the surface of each triangle defining an output image slows the process drastically. In many cases involving rapidly changing images, it has limited significantly the number of textures which can be applied. For this reason, a more recent development provides a pair of texture stages and a pair of texture blending stages in the pipeline. The first texture stage provides texture values describing a first texture at each pixel generated by the rasterizer which is blended with the pixel color values at the first texture blending stage. The output of the first texture blending stage is then furnished to the second texture blending stage along with texture values generated by the second texture stage. The output of the first texture blending stage and the texture values generated by the second texture stage are blended in the second texture blending stage and ultimately transferred to the frame buffer blender stage to be blended with the image data already in the frame buffer. This more advanced pipeline allows two textures to be blended with a surface in a single pass through the graphics pipeline.
Although this most recent development is useful in accelerating texture blending in a graphics pipeline, it is limited to producing a single pixel having at most two textures during any clock of the graphics pipeline and cannot be utilized for any other purposes. For example, if more than two textures are to be mapped to a surface, the additional textures require that the graphics pipeline be traversed again. The texture blending stages are capable of texture blending only, more complicated functions require the use of the host processor and the frame buffer blending stage and drastically slow the rendering of surfaces by the graphics accelerator.
It is desirable to provide a new computer graphics pipeline capable of both rendering triangles including multiple textures defining images on an output display and accomplishing a plurality of other functions without slowing the graphics pipeline.